<template>
  <div>
    <el-container>
      <el-header class="header" height="70px">
        <h2 class="title">电商后台管理系统</h2>
        <div class="right">
          <span class="welcome">欢迎回来，超级管理员！</span>
          <el-button class="logout" type="info" plain size="small"
          @click="logout"
            >退出登录</el-button
          >
        </div>
      </el-header>
    </el-container>
  </div>
</template>

<script>
export default {
  name: "Header",
  data(){
    return{

    }
  },

  methods:{
    // 退出登录
    logout(){
      sessionStorage.removeItem('token');
      this.$router.push({name:'Login'});
    }
  }
};
</script>

<style lang="less" scoped>
.header {
  width: 100%;
  background-color: #2d3a4b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eaeaea;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  left: 0;
  z-index: 999;
  border-bottom: none;
  .title{
    color: #fff;
  }
  .right {
    display: flex;
    align-items: center;
    position: relative;
  }
  .welcome {
    margin-right: 14px;
    margin-top: 8px;
    color: #fff;
  }
  .logout {
    font-size: 13px;
    margin-top: 8px;
  }
}
</style>